/*
  g++ -Wall -g -o life life-universe-everything.cpp &&./life
 */

#include <iostream>

using namespace std;

int main( int argc, char *argv[] ) {
    unsigned i;
    while ( !cin.eof() ) {
	cin >> i;
	if ( cin.eof() ) break;
	if ( i == 42 ) {
	    break;
	}
	cout << i << endl;
    }
    return 0;
}
